/**
 * @Description:
 * @Author bianpengfei
 * @create 2021/6/23 17:37
 */
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';

class Input3 extends PureComponent {
  constructor(props) {
    super(props)
    this.state = {}
    console.log('组件3：', this.props)
    /**
     * 解析get链接参数， 并返回对象
     * @param url
     * @returns {{}}
     */
    const parseQueryString = (url = '') => {
      const obj = {}
      const str = url?.split('?')?.[1]
      const arr = str?.split('&')
      arr?.forEach(v => {
        let item = v.split('=')
        let a = item[0]
        let b = item[1]
        obj[a] = b
      })
      return obj
    }

    console.log(parseQueryString(this.props?.location?.search))
  }

  render() {
    return (
      <div>
        <h1>组件3</h1>
      </div>
    );
  }
}

Input3.propTypes = {};

export default Input3;
